package com.luych.toolbox.docker.service.sdk.image.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class DockerImagesResult extends ArrayList<DockerImagesResult.Image> {
    public static class Image {

        @JsonProperty("ParentId")
        private String parentId;

        @JsonProperty("RepoDigests")
        private List<String> repoDigests;

        @JsonProperty("VirtualSize")
        private Long virtualSize;

        @JsonProperty("SharedSize")
        private Long sharedSize;

        @JsonProperty("RepoTags")
        private List<String> repoTags;

        @JsonProperty("Size")
        private Long size;

        @JsonProperty("Containers")
        private Long containers;

        @JsonProperty("Labels")
        private Map<String, String> labels;

        @JsonProperty("Id")
        private String id;

        @JsonProperty("Created")
        private Long created;

        public String getParentId() {
            return parentId;
        }

        public void setParentId(String parentId) {
            this.parentId = parentId;
        }

        public List<String> getRepoDigests() {
            return repoDigests;
        }

        public void setRepoDigests(List<String> repoDigests) {
            this.repoDigests = repoDigests;
        }

        public Long getVirtualSize() {
            return virtualSize;
        }

        public void setVirtualSize(Long virtualSize) {
            this.virtualSize = virtualSize;
        }

        public Long getSharedSize() {
            return sharedSize;
        }

        public void setSharedSize(Long sharedSize) {
            this.sharedSize = sharedSize;
        }

        public List<String> getRepoTags() {
            return repoTags;
        }

        public void setRepoTags(List<String> repoTags) {
            this.repoTags = repoTags;
        }

        public Long getSize() {
            return size;
        }

        public void setSize(Long size) {
            this.size = size;
        }

        public Long getContainers() {
            return containers;
        }

        public void setContainers(Long containers) {
            this.containers = containers;
        }

        public Map<String, String> getLabels() {
            return labels;
        }

        public void setLabels(Map<String, String> labels) {
            this.labels = labels;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public Long getCreated() {
            return created;
        }

        public Date getCreatedDate() {
            if (created == null) return null;
            return new Date(created * 1000);
        }

        public void setCreated(Long created) {
            this.created = created;
        }
    }
}
